package com.linhui.rpc.proxy;

import com.linhui.common.model.User;
import com.linhui.common.service.UserService;

import java.lang.reflect.Method;
import java.lang.reflect.Proxy;

/**
 * @author: 临晖
 * @since: 2024-05-11
 */
public class ServiceProxyFactory {
    public static <T> T getProxy(Class<T> serviceClass) {

        //通过接口对象获取其实例对象
        return (T) Proxy.newProxyInstance(
                serviceClass.getClassLoader(),
                new Class[]{serviceClass},
                new ServiceProxy()
        );


    }
}
